<?php

/**
 * BolaoUser form base class.
 *
 * @package    bolao-aabb
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseBolaoUserForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInputText(),
      'email'       => new sfWidgetFormInputText(),
      'home_phone'  => new sfWidgetFormInputText(),
      'cel_phone'   => new sfWidgetFormInputText(),
      'is_accepted' => new sfWidgetFormInputCheckbox(),
      'is_blocked'  => new sfWidgetFormInputCheckbox(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'BolaoUser', 'column' => 'id', 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 255)),
      'email'       => new sfValidatorString(array('max_length' => 255)),
      'home_phone'  => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'cel_phone'   => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'is_accepted' => new sfValidatorBoolean(),
      'is_blocked'  => new sfValidatorBoolean(),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'BolaoUser', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('bolao_user[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'BolaoUser';
  }


}
